<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>供需对接服务系统--项目列表</title>
	<!--公用样式-->
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/comment.css"/>
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/supplier/common/css/style.css"/>
	<!--Layui-->
	<link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
	<!--extended-->
	<link rel="stylesheet" type="text/css" href="${re.contextPath}/plugin/common/css/extended.css"/>
	<!--公用样式JS-->
	<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/comment.js"></script>
	<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.js" charset="utf-8"></script>
</head>
<style>
	.Right {
		width: 100%;
		overflow-y: scroll;
	}

</style>

<body>
<!--头部-->

<!--容器-->
<div class="container clearfix">
	<!--右侧内容-->
	<div class="Right fr mt10">
		<div class="project whitebg">
			<table id="tableList" class="layui-hide" lay-filter="tableList"></table>
		</div>
	</div>
</div>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/tabs.js"></script>
<script type="text/html" id="toolBarRow">
	<a class="layui-btn layui-btn-xs  layui-btn-normal" lay-event="detail" style="margin-left: 0px;">详情</a>
</script>
<script type="text/javascript">
	var layer;
	var form = layui.form;
	var table = null;
	var tableIns = null;
	//注意进度条依赖 element 模块，否则无法进行正常渲染和功能性操作
	var element = "";
	layui.use('element', function () {
		element = layui.element;


	});
	layui.use('laydate', function () {
		var laydate = layui.laydate;
		//执行一个laydate实例
		laydate.render({
			elem: '#beginDate' //指定元素
		});
		laydate.render({
			elem: '#endDate' //指定元素
		});
	});

	layui.use('table', function () {
		table = layui.table;
		element = element;
		//方法级渲染
		tableIns = table.render({
			id: 'tableList',
			elem: '#tableList',
			height: 'auto',
			url: '/sys/base/compileRule/showList',
			cols: [[
				{
					title: '序号', width: '15%', templet: function (res) {
						return res.LAY_INDEX;
					}
				},
				{field: 'id', title: '编号', hide: true, sort: false},
				{field: 'title', title: '规则名称', width: '40%', sort: false},
				{field: 'createDate', title: '创建时间', width: '25%', sort: false},
				{field: 'remark', title: '操作', width: '20%', toolbar: "#toolBarRow"}
			]],
			page: true,
			done: function (res, currentCount) {

			}
		});
		table.on('tool(tableList)', function (obj) {
			var data = obj.data;
			if (obj.event === 'detail') {
				var id=data.id;
				var w = ($(window).width() * 0.9);
				var h = ($(window).height() - 50);
				layer.open({
					id: 'type-add',
					type: 2,
					area: [w + 'px', h + 'px'],
					fix: false,
					maxmin: true,
					shadeClose: false,
					shade: 0.4,
					title: "规则详情",
					content: '/sys/base/compileRule/detail?id=' + id,
					yes: function () {
					},
					btn2: function () {
						layer.closeAll();
					},
					zIndex: layer.zIndex, //重点1,
					success: function (layero) {
						layer.setTop(layero); //重点2
					},
					end: function () {
						tableIns.reload();
					}
				});
			}



		});
	});

</script>
</body>

</html>
